const app = getApp()
export default {
	props: {
		title: {
			type: String,
			default: '提示'
		},
		// 内容
		value: {
			type: String,
			default: ''
		},
    inputPlaceholder: {
      type: String,
      default: ''
    },
		modalMargin: {
			type: String,
			default: '24'
		},
		heightPercent: {
			type: Number,
			default: 0.3
		},
    hideTitle: {
      type: Boolean,
      default: false
    },
    hideFooter: {
      type: Boolean,
      default: false
    },
    maskClick: {
      type: Boolean,
      default: true
    }
	},
	watch: {
	},
	data() {
		return {
      inputValue: '', 
      PRIMARY_TEXT_COLOR: app.globalData.PRIMARY_TEXT_COLOR,
    }
	},
  watch: {
    value(newVal, old) {
      if (newVal) {
        this.inputValue = newVal;
      }
    }
  },
	computed: {},
	methods: {
		toggleModal(isShow) {
			this.$refs.noticeModal.toggleModal(isShow)
		},
		handleTap() {
      if (!this.inputValue) {
        return uni.showToast({ title: '输入内容不能为空', icon: 'none' })
      }
			this.$emit('onConfirm', this.inputValue)
		},
    // 取消
    handleCancel() {
      this.toggleModal(false)
    }
	}
}